<html>
<head>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>最新日剧</title>
    <!-- <link rel="stylesheet" type="text/css" href="http://www.zhuixinfan.com/data/cache/style_1_common.css?st9"> -->
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <style>
      body { padding-top:0; }
      .hidden { display:none; }
      .table thead th { border-bottom: none;vertical-align: middle; }
      .table th { border: none; }
    </style>
</head>
<body>
    <table class="table table-striped table-condensed hidden dorama-box">
        <thead>
            <tr>
                <th class="td-m1" style="width: 56px">序号</th>
                <th class="td-m2">名称</th>
                <th class="td-m3" style="width: 80px">类型</th>
                <th class="td-m4" style="width: 60px">状态</th>
                <th class="td-m7" style="width: 50px">首播时间</th>
                <th class="td-m8" style="width: 75px">下载量</th>
            </tr>
        </thead>
        <tbody class="xml-box">

        </tbody>
    </table>

    <table class="table table-striped table-condensed hidden res-box">
        <thead>
            <tr>
                <th class="tdt1" style="width: 56px">序号</th>
                <th class="tdt2">名称</th>
            </tr>
        </thead>
        <tbody class="res-xml-box">

        </tbody>
    </table>

  <table class="table table-bordered pc hidden">
      <thead>
        <tr>
          <th width="8%">序号</th>
          <th width="20%">场馆名称</th>
          <th width="25%">地址</th>
          <th width="10%">区域</th>
          <th width="7%">联系电话</th>
        </tr>
      </thead>
      <tbody id="stadium-box">

      </tbody>
  </table>

<script id="stadium-tmp" type="text/html">
    {{each list value i}}
    <tr>
        <td>{{(i+1)}}</td>
        <td>{{list[i].stadium_name}}</td>
        <td>{{list[i].stadium_address}}</td>
        <td>{{list[i].stadium_area_name}}</td>
        <td>{{list[i].stadium_phone}}</td>
    </tr>
    {{/each}}
</script>
<script id="stadium-mb-tmp" type="text/html">
    {{each list value i}}
    <tr>
        <td>{{(i+1)}}</td>
        <td>
            <div>{{list[i].stadium_name}}</div>
            <div>
               联系地址：{{list[i].stadium_area_name}} {{list[i].stadium_address}}
            </div>
            <div>联系电话：{{list[i].stadium_phone}}</div>
        </td>
    </tr>
    {{/each}}
</script>



</body>
<script src="http://tiaocaoer.com:18885/template-web.js"></script>
<script>
    //平台、设备和操作系统
    var system = {
        win: false,
        mac: false,
        xll: false
    };
    var is_mobile = 0;
    //检测平台
    var p = navigator.platform;
    system.win = p.indexOf("Win") == 0;
    system.mac = p.indexOf("Mac") == 0;
    system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
    //跳转语句
    if (system.win || system.mac || system.xll) {

    } else {
        is_mobile = 1;
    }

    function getNews() {
        $.ajax({
            url: "http://www.tiaocaoer.com:18883/doramalist",
            type: "get",
            datatype:'xml',
            success: function (res) {
            }
        }).done(function(res){

              $('.xml-box').html(res);
              $('.add-tv').hide();
              $('.td2 a:nth-child(1)').remove();
              var link = $('.td2 a:first-child');
              link.attr('href','javascript:;').attr('class','name');

              $('.td8,.td-m8').hide()
              $('.dorama-box').removeClass('hidden');
        });
    }

    

    //URL参数取得
    function getQueryString(key){
        var reg = new RegExp("(^|&)"+key+"=([^&]*)(&|$)");
        var result = window.location.search.substr(1).match(reg);
        return result?decodeURIComponent(result[2]):null;
    };

    $(function () {
    var pid = getQueryString('pid');

    function getDoramas() {
        $.ajax({
            url: "http://www.tiaocaoer.com:18883/doramalist",
            type: "get",
            data:{
                res:1,
                pid:pid
            },
            datatype:'xml',
            success: function (res) {
            }
        }).done(function(res){

              $('.res-xml-box').html(res);
              $('.res-xml-box td:nth-child(3),.res-xml-box td:nth-child(4)').remove();
              $('.res-xml-box tr').each(function(){
                    var _tr = $(this),
                    _a = _tr.find('a');
                    _a.attr('data-url',_a.attr('href'))
                    .attr('href','javascript:;');
              });
              $('.res-box').removeClass('hidden');
        });
    }

    if(pid!=undefined){
        getDoramas();
        $('body').on('click','.td2 a:nth-child(1)',function(e){
            e.stopPropagation();
            var url = $(this).data('url');
            window.open('http://www.zhuixinfan.com/' + url);
        });
    }else{
        getNews();
        $('body').on('click','.td2 a.name',function(e){
            e.stopPropagation();
            var url = $(this).next().attr('id');
            var pid = url.substr(url.indexOf('_')+1, url.length);
            window.open('index.html?pid=' + pid);
        });
    }
    
});
</script>
</html>